//
//  MacroDefinitions.h
//  MobileOffice
//
//  Created by jjkj on 17/2/27.
//  Copyright © 2017年 liaoningjujin. All rights reserved.
//

#import "MacroDefinitions.h"

#define NAMESPACE @"\"http://tempuri.org/\""
//JPUSH appkey
#define JGAPPKEY @"dd2de53edd89991c80dccecf"
#define  kWindow  [UIApplication sharedApplication].keyWindow
//油站ID
#define kIolID @"3bc25ad91d674732b8802e28ed53a3f8"

//应用的内部版本号 对应的是build
#define APP_CLIENT_VERSION [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]
//上传到AppStore上面的版本号 对应的是version
#define AppStore_VERSION [[NSBundle mainBundle]   objectForInfoDictionaryKey:@"CFBundleShortVersionString"]


//判断系统版本
#define kCurrentSystemVersion [[[UIDevice currentDevice] systemVersion] floatValue]
//判断是否是iOS7或更高的系统版本
#define IOS_VERSION_7_OR_LATER (([[[UIDevice currentDevice] systemVersion] floatValue] >=7.0)? (YES):(NO))
//判断是否是iOS8或更高的系统版本
#define IOS_VERSION_8_OR_LATER (([[[UIDevice currentDevice] systemVersion] floatValue] >=8.0)? (YES):(NO))
//判断是否是iOS10或更高的系统版本
#define IOS_VERSION_10_OR_LATER (([[[UIDevice currentDevice] systemVersion] floatValue] >=10.0)? (YES):(NO))
//RGB颜色
#define COLOR(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]

//请求url
#define URL(IP,API) [NSString stringWithFormat:@"%@%@",IP,API]


//分割线颜色
#define BACKCOLOR_GRAY @"#CCCCCC"
#define LABLE_COLOR @"#666666"
#define BACKCOLOR_BLUE @"#158CCB"
#define COLOR_MIDBLUE [UIColor colorWithRed:37/255.0 green:89/255.0 blue:137/255.0 alpha:1]//中蓝

#define OLD_TIME_FORMATTER  @"yyyy-MM-dd'T'HH:mm:ss"
#define NEW_TIME_FORMATTER_DATE @"yyyy-MM-dd"
#define TIME_FORMATTER_24 @"yyyy-MM-dd HH:mm:ss"
#define TIME_FORMATTER_YM @"yyyy-MM"
#define TIME_FORMATTER_DD @"dd"
#define TIME_FORMATTER_HM @"HH:mm"
#define TIME_FORMATTER_HH @"HH"

#define NETWORKCHANGE   @"NetworkChange"
#define NETWORK_3G      @"3G"
#define NETWORK_WIFI    @"WIFI"
#define NETWORK_UNKNOW  @"Unknow"
#define NETWORK_NOTHING @"Nothing"
#define SUBVIEWSHOWED     @"UnityShow"
#define JPUSHREFRESH    @"JPushRefresh"
//对无数据时的处理
#define INTERNET_ERROR  @"网络请求失败!"
#define INTERNET_NODATA @"暂无相关数据!"
//PUD
#define HUD_PLEASEWAIT @"请稍等..."
/** 端口*/
#define PORT @"Port"
/** IP*/
#define IP @"IP"

/** 登录名称*/
#define LOGIN_USERNAME     @"username"
/** 登录密码*/
#define LOGIN_PASSWORD     @"password"
/**用户唯一表示 即用户id*/
#define LOGIN_SESSIONID    @"sessionId"
/**JPUSH registrationID*/
#define REGISTRATIONID     @"registrationID"
/**用户权限*/
#define LOGIN_USERPOWER    @"userpower"
/** 人员名称*/
#define LOGIN_PERSONNAME   @"personName"
/** 是否自动登录*/
#define ISAUTOLOGIN        @"isAutoLogin"
/** 是否记住密码*/
#define ISREMEBERPWD       @"isRemeberPwd"

#define UNREADMESSAGE      @"unreadMesaage"

#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height 

typedef NS_ENUM(NSUInteger, RolePower) {
    RolePowerAdmin = 1,
    RolePowerYZLeader,
    RolePowerCLLeader,
    RolePowerInternalLeader
};
typedef NS_ENUM(NSUInteger, HomePageType) {
    HomePageTypeYZ =0,
    HomePageTypeCL
};

//DEBUG  模式下打印日志,当前行
#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define DLog(...)
#endif

//DEBUG 模式下打印日志,当前行 并弹出一个警告
#ifdef DEBUG
#  define ALog(fmt, ...)  { UIAlertView *alert = [[UIAlertView alloc]initWithTitle:[NSString stringWithFormat:@"%s\n [Line %d] ", __PRETTY_FUNCTION__, __LINE__] message:[NSString stringWithFormat:fmt,##__VA_ARGS__] delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; }
#else
#  define ALog(...)
#endif

